<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>创客续费</title>
		<script src="../../js/jquery-2.2.3.min.js"></script>
		<link href="../../js/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet">
		<link rel="stylesheet" type="text/css" href="../../css/reset.css" />
		<link rel="stylesheet" type="text/css" href="footer.css" />
		<link rel="stylesheet" href="../../css/lystyle.css" />
		<link rel="stylesheet" href="../../css/backstage.css" />
		<style type="text/css">
			/*修改底部字体颜色*/
			
			.foot:nth-child(2) {
				color: #e83023;
			}
			
			#showPic1 {
				width: 100%;
				height: 100%;
			}
			
			.imgG {
				width: 5.8333rem;
				height: 3.75rem;
				margin: 0.2083rem auto;
				margin-left: 2.0833rem;
				display: none;
			}
			
			div.webuploader-pick {
				background-color: #00b7ee;
				width: 78px;
				height: 32px;
				font-size: 0.277777rem;
				text-align: center;
				padding-top: 0.208333rem;
				padding-bottom: 0.208333rem;
			}
			
			div.webuploader-pick-hover {
				background-color: #00a2d4;
				width: 78px;
				height: 32px;
			}
		</style>
		<script src="../../js/flexible.min.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body class="ly-bgcolor">
		<div id="wrap">
			<div id="main">
				<div id="header">
					<a id="headImg" href="javascript:history.go(-1)"><img class="headImg" src="../../images/12.png" /></a>
					<p id="headTitle">创客续费</p>
				</div>
				<div id="content" style="padding-bottom: 1.319444rem;">
					<div class="ly-form">
						<div class="ly-form-item">
							<div class="row ly-item-content">
								<label class="control-label col-xs-3 ly-form-label" style="text-align: right;">*真实姓名:</label>
								<div class="col-xs-9">
									<span id="trueName"></span>
								</div>
							</div>
						</div>
						<div class="ly-form-item">
							<div class="row ly-item-content">
								<label class="control-label col-xs-3 ly-form-label" style="text-align: right;">*手机号:</label>
								<div class="col-xs-9">
									<span id="mobile"></span>
								</div>
							</div>
						</div>
						<div class="ly-form-item">
							<div class="row ly-item-content">
								<label class="control-label col-xs-3 ly-form-label" style="text-align: right;">*邮箱:</label>
								<span id="email"></span>
							</div>
						</div>
						<div class="ly-form-item">
							<div class="row ly-item-content">
								<label class="control-label col-xs-3 ly-form-label" style="text-align: right;">*身份证号:</label>
								<span id="identityNumber"></span>
							</div>
						</div>
						<div class="ly-form-item">
							<div class="row ly-item-content">
								<label class="control-label col-xs-3 ly-form-label" style="text-align: right;">*推荐号:</label>
								<span id="gratitude"></span>
							</div>
						</div>
						<div class="row ly-item-content">
							<label class="control-label col-xs-3 ly-form-label" style="text-align: right;">到期时间:</label>
							<div class="col-xs-9">
								<span id="dueDate"></span>
							</div>
						</div>
					</div>
				</div>
				<div style="padding: 0.33rem;">
					<span style="color: #e83023;">续费创客一年费用：399元</span>
					<a id="submit" style="display: block;color: #fff;" class="ly-borderp">续费</a>
				</div>
			</div>
		</div>
		<!--图片资料-->
		<input type="hidden" value="" id="zl1" />
		<input type="hidden" value="" id="zl2" />
		<input type="hidden" value="" id="zl3" />
		<div id="alipayHtml">

		</div>
	</body>
	<style type="text/css">
		/**/
		
		#l-map {
			height: 300px;
			width: 100%;
		}
		
		#r-result {
			width: 100%;
		}
		/*图片上传*/
		
		.webuploader-container {
			position: relative;
		}
		
		.webuploader-element-invisible {
			position: absolute !important;
			clip: rect(1px, 1px, 1px, 1px);
			/* IE6, IE7 */
			clip: rect(1px, 1px, 1px, 1px);
		}
		
		.webuploader-pick {
			font-size: 14px;
			position: relative;
			display: inline-block;
			cursor: pointer;
			padding: 5px 12px 5px;
			background: #337ab7;
			color: #fff;
			text-align: center;
			border-radius: 3px;
			overflow: hidden;
		}
		
		.webuploader-pick-hover {
			background: #33A6E7;
		}
		
		.webuploader-pick-disable {
			opacity: 0.6;
			pointer-events: none;
		}
	</style>
	<script src="../../js/jquery.cookie.js"></script>
	<script src="../../../common/js/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
	<script type="text/javascript">
		var tokenReztApp = $.cookie("tokenReztApp");
		console.log(tokenReztApp);
		if(!tokenReztApp) {
			/*window.location.href = "../login/login/login.html";*/
		}
		$(function() {
			currentyf();
		});

		//用户信息
		var user, role, goodsId;
		//获取当前会员信息
		function currentyf() {
			$.ajax({
				cache: false,
				type: "GET",
				url: "http://47.104.13.109/member-service/auth/current?token=" + tokenReztApp,
				dataType: "JSON",
				async: false,
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					$.removeCookie('tokenReztApp', {
						expires: 7,
						path: '/'
					});
					$.removeCookie("tokenRh", {
						expires: 7,
						path: '/'
					});
					$.removeCookie('memberId', {
						expires: 7,
						path: '/'
					});
					$.removeCookie('roleId', {
						expires: 7,
						path: '/'
					});
					window.location.href = "../login/login/login.html";
				},
				success: function(data) {
					/*if(data.roleList[0].id != "f2") {
						window.location.href = "../../view/login/login/login.html";
					}*/
					user = data.loginName;
					role = data.roleList[0].id; //角色
					goodsId = data.id;

				}
			});
		}
		$(function() {
			selectMakerInfo();
		});
		//查询当前用户的创客信息
		function selectMakerInfo() {
			$.ajax({
				cache: false,
				type: "GET",
				url: "http://10.0.47.157:5555/applyfor-service/founder/searchUserType?type=1&applyforUser=f1450448928",
				dataType: "JSON",
				async: false,
				error: function(XMLHttpRequest, textStatus, errorThrown) {

				},
				success: function(data) {
					$("#trueName").html(data.trueName);
					$("#mobile").html(data.mobile);
					$("#email").html(data.email);
					$("#identityNumber").html(data.identityNumber);
					$("#gratitude").html(data.gratitude);
				}
			});
		}

		/*
				$("#img3").attr("src", "http://oxjfr3ifx.bkt.clouddn.com/" + response._raw);
				$("#img3").show();*/

		$(document).ready(function() {
			$("#submit").click(function() {
				if($("#trueName").val() == '' || $("#mobile").val() == '' || $("#email").val() == '' || $("#identityNumber").val() == '') {
					return alert("请将信息填写完整");
				}
				var pattern1 = /^1\d{10}$/; //手机号
				var pattern2 = /^\w+[@]\w+[.][\w.]+$/; //邮箱
				var pattern3 = /^\d{15}|\d{}18$/; //身份证号

				if(!pattern1.test($("#mobile").val())) {
					return alert("请输入正确的手机号码");
				}
				if(!pattern2.test($("#email").val())) {
					return alert("请输入正确的邮箱地址");
				}
				if(!pattern3.test($("#identityNumber").val())) {
					return alert("请输入正确的身份证号");
				}
				//图片链接
				var zl1 = $("#zl1").val();
				var zl2 = $("#zl2").val();
				var zl3 = $("#zl3").val();
				//图片链接
				if(zl1 == "") {
					alert("请上传身份证正面");
					return;
				}
				//图片链接
				if(zl2 == "") {
					alert("请上传身份证反面");
					return;
				}
				if(zl3 == "") {
					alert("请上传手持身份证照片");
					return;
				}
				$.ajax({
					type: "post",
					url: "http://47.104.13.109/applyfor-service/founder/applyfor",
					async: true,
					data: {
						applyforType: '1',
						applyforUser: user,
						gratitude: $("#gratitude").val(),
						fansname: $("#trueName").val(),
						trueName: $("#trueName").val(),
						mobile: $("#mobile").val(),
						email: $("#email").val(),
						identityNumber: $("#identityNumber").val(),
						identityJusturl: zl1,
						identityAgainsturl: zl2,
						identityHandurl: zl3,
						membercost: '199', //支付金额
						buapSpare1: tokenReztApp
					},
					error: function(data) {
						alert("网络异常请稍后重试");
					},
					success: function(data) {
						console.log(data);
						if(data.code == 1) {
							var form = data.approve;
							$("#alipayHtml").append(form);
						} else {
							alert(data.message);
						}
					}
				});
			})

		})
	</script>

</html>